package com.Interface.TestIO;

import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

public class test3 {
    public static void main(String[] args) throws Exception {
//        File file = new File("D:\\JAVA\\schoolSystem\\src\\com\\Interface\\TestIO\\file\\test1");
        String path = "D:\\JAVA\\schoolSystem\\src\\com\\Interface\\TestIO\\file\\test1";
        OutputStream outputStream = new FileOutputStream(path);

        String str = "qwerthh你好啊nfan&&&&afvdsgfe拿到萨莱诺！";
//        byte[] bytes = str.getBytes();
        byte[] bytes = str.getBytes(StandardCharsets.UTF_8);

        outputStream.write(bytes);//写操作，写入文本

        outputStream.close();//关闭流（记得每次加）

    }
}
